package com.course.service.impl;

import com.course.entity.ResultBody;
import com.course.mapper.EditDetailsMapper;
import com.course.service.EditDetailsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Map;

@Service
public class EditDetailsServiceImpl implements EditDetailsService {
    @Autowired
    private EditDetailsMapper editDetailsMapper;
    @Override
    public ResultBody EditDetailsUser(Map<String,Object> map) {
        if (editDetailsMapper.EditDetailsUser(map)== 0) {
            return new ResultBody(400, "编辑失败,学号错误", false);
        } else
            return new ResultBody(200, "编辑成功", true);
    }
    @Override
    public ResultBody lookMessage(String usernumber)
    {
        if(editDetailsMapper.lookMessage(usernumber).size()==0)
        {
            return new ResultBody(400,"查看个人资料失败，学号错误",false);
        }
        else
        {
            return new ResultBody(200,"查看个人资料成功",editDetailsMapper.lookMessage(usernumber));
        }
    }

}
